package com.inibb.app.converter;

import java.util.ArrayList;
import java.util.List;

import com.inibb.app.po.Note;
import com.inibb.app.vo.NoteVO;

public class NoteConvertor {
	
	public static List<NoteVO> converPOs2VOs(List<Note> pos){
		List<NoteVO> vos = new ArrayList<NoteVO>();
		for(Note po:pos){
			vos.add(converPO2VO(po));
		}
		return vos;
	}
	
	public static List<Note> converVOs2POs(List<NoteVO> vos){
		List<Note> pos = new ArrayList<Note>();
		for(NoteVO vo:vos){
			pos.add(converVO2PO(vo));
		}
		return pos;
	}
	
	public static NoteVO converPO2VO(Note s){
		NoteVO vo = new NoteVO();
		vo.setNoteType(s.getNoteType());
		vo.setActvInd(s.getActvInd());
		vo.setNoteId(s.getNoteId());
		vo.setParentId(s.getParentId());
		vo.setSubjectInd(s.getSubjectInd());
		vo.setContent(s.getContent());
		vo.setEditableInd(s.getEditableInd());
		vo.setTitle(s.getTitle());
		BaseVOConvertor.converPO2VO(s, vo);
		return vo;
	}
	
	public static Note converVO2PO(NoteVO vo){
		Note po = new Note();
		po.setNoteType(vo.getNoteType());
		po.setActvInd(vo.getActvInd());
		po.setNoteId(vo.getNoteId());
		po.setParentId(vo.getParentId());
		po.setContent(vo.getContent());
		po.setEditableInd(vo.getEditableInd());
		po.setSubjectInd(vo.getSubjectInd());
		po.setTitle(vo.getTitle());
		BaseVOConvertor.converVO2PO(vo, po);
		return po;
	}
}
